﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using MenusHunter.WinRT.Core.Services.Food;

namespace MenusHunter.WinRT.Core.Models
{
    public class FoodsManager
    {
        public static async Task<ObservableCollection<Food>> GetListFoodRestaurant(int restaurantId)
        {
            var client = new FoodsManager1SoapClient();

            var response = await client.GetListFoodByRestaurantAsync(restaurantId);

            return response.Body.GetListFoodByRestaurantResult;
        }

        public static async Task<int> NewFood(Food food)
        {
            var client = new FoodsManager1SoapClient();
            
            var response = await client.NewFoodAsync(food.RestaurantId, food.Name, food.Description, food.ImageUrl, food.Price,
                                               food.Currency, food.Status);

            return response.Body.NewFoodResult;
        }
    }

    public enum FoodStatus
    {
        SoldOut = 0,
        InStock = 1
    }
}
